<?php
require_once '../connect/connect.php';
extract($_POST);
$tbl_name="forum_question";
$topic=$_POST['topic'];
$detail=$_POST['detail'];
//$name=$_POST['name'];
//$email=$_POST['email'];

$datetime=date("d/m/y h:i:s"); //create date time

//$sql="INSERT INTO $tbl_name(topic, detail, name, email, datetime)VALUES('$topic', '$detail', '$name', '$email', '$datetime')";
$sql="INSERT INTO $tbl_name(topic, detail, datetime)VALUES('$topic', '$detail', '$datetime')";
$result=mysql_query($sql);

if($result){
header("location:main_forum.php");
}
else {
echo "ERROR";
}
mysql_close();
require_once 'footer.php';
?>